/*
 * @version: 
 * @Author: yu
 * @Date: 2023-07-13 16:14:21
 * @LastEditors: Andy
 * @LastEditTime: 2023-07-13 16:59:02
 */
import { cateList } from '@/request/api'


interface stateCate {
    list: Array<Object>
}


const state = {
    list: []
}

const getters = {
    getCate(state: stateCate) {
        return state.list
    }
}


const mutations = {
    mutationsList(state: stateCate, payload: any) {
        state.list = payload
    }
}


const actions = {
    listActions(context: any) {
        cateList().then((res: any) => {
            // console.log(res);
            context.commit('mutationsList', res.list)
        })
    }
}

export default {
    state,
    getters,
    mutations,
    actions,
    namespaced: true
}